package obecto.event
{
	import flash.events.IEventDispatcher;
	
	/**
	 * In broadcast implementations of event-driven environments such as 
	 * Flex and Flash, an event is fully described through its event source 
	 * (or the object from which this event originates), and the name which 
	 * distinguishes the event from the other events originating from the 
	 * same source.  
	 */
	public class EventDescriptor
	{
		private var _eventSource : IEventDispatcher;
		private var _eventName : String;
		
		public function get eventSource() : IEventDispatcher
		{
			return _eventSource;
		}
	
		public function get eventName() : String
		{
			return _eventName;
		}
		
		public function EventDescriptor(aEventSource : IEventDispatcher, aEventName : String)
		{
			_eventSource = aEventSource;
			_eventName = aEventName;
		}
		
		public function equals(target : EventDescriptor) : Boolean
		{
			return ((_eventSource === target.eventSource) && (_eventName == target.eventName)); 
		}
	}
}